package qsort;

import java.util.ArrayList;

public class Record implements Comparable<Record> {
	String data; 
	ArrayList<String> keys ;
	
	public Record(){
		
	}
	public Record(String data, ArrayList<String> keys) {
		super();
		this.data = data;
		this.keys = keys;
	}
	public String getData() {
		return data;
	}
	public void setData(String data) {
		this.data = data;
	}
	public ArrayList<String> getKeys() {
		return keys;
	}
	public void setKeys(ArrayList<String> keys) {
		this.keys = keys;
	}
	@Override
	public int compareTo(Record otherRecord) {
		for (int i=0; i<this.keys.size(); i++){
			String key1 = this.keys.get(i);
			String key2 = otherRecord.getKeys().get(i);
			int temp =key1.compareTo(key2);  
			if (temp!=0){
				return temp;  
			}
		}
		return 0;
	}
	
}
